import request from '@/utils/request'

const Api = {
    list: '/api/v1/case/list',
    defail: '/api/v1/case',
    create: '/api/v1/case/create',
    modify: '/api/v1/case/modify',
    delete: '/api/v1/case/delete',
}

class Testcase {
    Create = async (data) => {
        return await request({
            url: Api.create, method: 'post', data: data,
        })
    }

    Detail = async (data) => {
        return await request({
            url: Api.defail + "/" + data, method: 'get', param: {id: data},
        })
    }

    List = async () => {
        return await request({
            url: Api.list, method: 'get',
        })
    }

    Modify = async (data) => {
        return await request({
            url: Api.modify, method: 'put', data: data
        })
    }

    Delete = async (data) => {
        return await request({
            url: Api.delete, method: 'delete', data: data
        })
    }
}


export const testcase = new Testcase()